var express = require('express');
var router = express.Router();
var request = require('request');
var itemDao = require('../dao/itemDao');
var userAgentUtil = require('../utils/userAgent');
var $constant = require('../utils/constant');

router.get('/', function(req, res, next) {
  var param = req.query || req.params;
  itemDao.query(param, function(result){
   if(userAgentUtil.isM(req)){
    res.render('m/detail.html',{item:result.data[0]});
   }
   else
    res.render('m/detail.html',{item:result.data[0]});
});

});



module.exports = router;
